#pragma once

#include <Totem/types_config.h>
#include <Totem/ComponentFactory.h>

namespace Game
{
	class Entity;
	class EntityManager
	{
	public:
		EntityManager() : nextEntityId(0) {}
		~EntityManager();

		void update(const float &deltaTime);

		Entity &create();
		void push_back(Entity *entity);
		void erase(Entity *Entity, bool pending);
		std::vector<Entity*> &getEntities() { return entities; }

		Totem::ComponentFactory &getFactory() { return factory; }
	protected:
		std::vector<Entity*> entities;
		std::vector<Entity*> pendingDelete;
		unsigned int nextEntityId;
		Totem::ComponentFactory factory;
	};
}
